FROM registry.cn-shenzhen.aliyuncs.com/xiao5/kdx:v231230

RUN cd /var/www/html && \
    git clone -b master https://gitee.com/C014A22613E72FC94555C18A80E73832/kdx.git ./ && \
    composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ &&  \
    composer install && \
    chown -R www-data:www-data runtime && \
    chown -R www-data:www-data config && \
    chown -R www-data:www-data public && \
    chown -R www-data:www-data tmp

RUN sed -i '142 a\public \$interactive = false;' vendor/yiisoft/yii2/console/controllers/MigrateController.php && \
    sed -i '64 a\\\shopstar\\helpers\\LogHelper::error("[INIT MIGRATE RESULT]:", [shell_exec("php /var/www/html/yii migrate/up")]);' install/controllers/api/InstallController.php && \
    sed -i 's/mysql_host:"127.0.0.1",mysql_port:"3306",mysql_database:"",mysql_username:"",mysql_password:"",redis_host:"127.0.0.1",redis_port:"6379",redis_password:""/mysql_host:"172.10.0.5",mysql_port:"3306",mysql_database:"kdx",mysql_username:"root",mysql_password:"123456",redis_host:"172.10.0.4",redis_port:"6379",redis_password:""/g' public/static/dist/install/js/chunk-91e46d94.js

